package com.yitiao.designmodel.struct.adapter;

public class MoviePlayerAdapter extends En_ChTranslater implements Target {

    private final MoviePlayer moviePlayer;
    private final En_ChTranslater translator =new En_ChTranslater();

    public MoviePlayerAdapter(MoviePlayer moviePlayer) {
        this.moviePlayer = moviePlayer;
    }

    @Override
    public void playAndTranslate() {
        String words = moviePlayer.play();
        String translate = translator.translate(words);
        System.out.println("翻译："+translate);
    }
}
